package org.csu.mall.common;

import lombok.Getter;

@Getter
public enum ResponseCode {

    SUCCESS(0, "SUCCESS"),
    ERROR(1, "ERROR"),
    ILLEGAL_ARGUMENT(2, "ILLEGAL_ARGUMENT"),
    USER_NOT_LOGIN(3, "用户未登录"),
    DATABASE_EXECUTION_ERROR(4, "数据库操作执行错误"),
    //注册
    USERNAME_EXIST(5, "用户名已存在"),
    PHONE_NUMBER_EXIST(6, "电话号码已注册"),
    EMAIL_EXIST(7, "邮箱已注册"),
    //登录
    USERNAME_NOT_EXIST(8, "用户名不存在"),
    USERNAME_PASSWORD_ERROR(9, "用户名或密码错误"),
    //忘记密码
    QUESTION_NOT_EXIST(10, "未设置安全问题"),
    ANSWER_ERROR(11, "问题回答错误"),
    TOKEN_ERROR_TIMEOUT(12, "令牌失效或错误"),
    //实名认证
    ID_CARD_REGISTER(13, "该身份已注册"),
    //商品状态
    COMMODITY_NOT_EXIST(14, "商品不存在"),
    COMMODITY_SALE_OUT(15, "商品已售空"),
    //发布商品
    PERMISSION_DENIED(16, "权限不足"),
    //新增类别
    CATEGORY_EXIST(17, "类别已存在"),
    CATEGORY_NOT_EXIST(18, "类别不存在"),
    //订单
    ADDRESS_NEEDED(19, "地址未填写"),
    STOCK_NOT_ENOUGH(20, "库存不足"),
    CUSTOMER_ORDER_NOT_EXIST(21, "顾客订单不存在"),
    BALANCE_NOT_ENOUGH(22, "余额不足"),
    ORDER_CANNOT_CANCEL(23, "订单交易成功不能取消"),
    ORDER_NOT_EXIST(24, "订单不存在");

    private final int code;

    private final String description;

    ResponseCode(int code, String description){
        this.code = code;
        this.description = description;
    }
}
